﻿@model EvincePayroll.Data.UserRoleData

   <script type="text/javascript">
       $(document).ready(function () {
           $('#NameError').hide();
           $('#btnCancel').click(function () {

               $('#txtName').val('');
               return false;

           });

           $('#validate1').submit(function () {
               var flag = false;
               $('#NameError').hide();
               var name = $('#txtName').val();
               if (name == "") {

                   $('#NameError').show();
                   flag = true;
               }
               if (flag == true) {

                   return false;
               }
           });

       });
   
   
   </script>
    

    
 @using (Html.BeginForm("_CreateRole", "UserRole", FormMethod.Post, new { id = "validate1" }))
    { 
    <div class="grid_5">
        <div class="box round">
           <h2>Create User Role</h2>
           <br />
          <ul style="border: 1px solid gray;">
          <br />
                            <li id="li_1">
                                <label class="description" for="element_2">
                                    RoleName
                                </label>
                                <br />
                                <div>
                                   <input type="text" id="txtName" name="RoleName" />
                                   <span class="error" id="NameError">Required</span>
                                </div>
                            </li>
                            
                            <li id="li_4">
                                <br />
                                <button class="btn btn-orange" runat="server">
                                    Add</button>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <button class="btn btn-orange" id="btnCancel">
                                    Cancel</button>
                            </li>
                            <br />
                        </ul>
                    </div>
                    </div>
        
    }
